package com.yanqu.road.server.cross3server.cmd.dispersegold;

import com.yanqu.road.pb.cross.disperseGold.CrossDisperseGoldProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Cross3Protocol;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Cross3Protocol.C3_DISPERSE_GOLD_SEND_RESULT_FROM_CHANNEL, desc = "跨服返回送财结果 跨地区服返回")
public class Cross3DisperseGoldResultFromChannelCmd extends CrossCommand {

    private long serverId;
    private CrossDisperseGoldProto.CrossDisperseGoldInfoMsg reqMsg;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        reqMsg = CrossDisperseGoldProto.CrossDisperseGoldInfoMsg.parseFrom(packet.getBytes());
        serverId = reqMsg.getServerId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        YanQuMessage pbMsg = YanQuMessageUtils.buildMessage(Protocol.S_CROSS_DISPERSEGOLD_RESULT, reqMsg);
        MessageHelper.sendPacket(serverId, 0, pbMsg);
    }

    @Override
    public void sendData() {

    }
}
